﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XMKLogView.aspx.cs" Inherits="XMK.Tadong.Web.Views.DataSearch.XMKLogView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%: lang.Get("Log_query")%></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="../../weblib/jquery/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../../weblib/jquery/jquery.adaptor.js" type="text/javascript"></script>
    <script src="../../weblib/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../weblib/jquery.easyui/jquery.easyui.adaptor.js" type="text/javascript"></script>
    <link href="../../weblib/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../weblib/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../weblib/skins/style.css" rel="stylesheet" type="text/css" />
    <script src="../../WebFileExplorer/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link href="../../weblib/skins/layout.css" rel="stylesheet" type="text/css" />
    <link href="../../weblib/skins/sexybuttons.css" rel="stylesheet" type="text/css" />
     <script src="../../webjs/core/index.js" type="text/javascript"></script>
     <script type="text/javascript">
         var language = $.cookie('_language_');
         if (language == null || language == '') {
             document.write("<script src='../../Language/sys_language/zh.js'><\/script>");
         }
         else if (Number(language) == 1) {
             document.write("<script src='../../Language/sys_language/zh.js'><\/script>");
         }
         else if (Number(language) == 0) {
             document.write("<script src='../../Language/sys_language/en.js'><\/script>");
         }
         document.write("<script src='XMKLogView.js'><\/script>");
       

   </script>
   <%-- <script type="text/javascript">

        $(function () {


            $("#btnSearch").click(function () {
                $("#logTable").datagrid({
                    url: '../../Handlers/LogHandler.aspx?op=search',
                    method: "post",
                    queryParams:
                {
                    startDate: $("#startDate").val(),
                    endDate: $("#endDate").val(),
                    logType: $("#logType").combobox("getValue"),
                    uid: $("#uid").combogrid("getValue"),
                    txtKeyw: $("#txtKeyw").val()
                },
                    columns: [[
                    { field: "UserName",
                        title: "用户名",
                        width: 80,
                        align: 'center',
                        sortable: true
                    },
                    {
                        field: "UserAccount",
                        title: "账户",
                        width: 80,
                        align: 'center',
                        sortable: true
                    },
                    {
                        field: "OperateTime",
                        title: "操作时间",
                        width: 150,
                        align: 'center',
                        sortable: true
                    },
                    {
                        field: "LogDesc",
                        title: "日志内容",
                        width: 300,
                        align: 'center',
                        sortable: true
                    },
                    {
                        field: "IP",
                        title: "IP地址",
                        width: 200,
                        align: 'center',
                        sortable: true
                    }
                ]],
                    rownumbers: true,
                    animate: true,
                    fit: true,
                    pageSize: 20,
                    pagination: true,
                    singleSelect: true,
                    pagePosition: 'top',
                    striped: true,
                    remoteSort: false
                });

                //设置分页控件  
                var p = $('#logTable').datagrid('getPager');

                $(p).pagination({
                    pageSize: 20, //每页显示的记录条数，默认为10  
                    pageList: [20, 30], //可以设置每页记录条数的列表  
                    beforePageText: '第', //页数文本框前显示的汉字  
                    afterPageText: '页    共 {pages} 页',
                    //displayMsg: '',
                    displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'

                });



            });

            $("#btnServerExport").click(function () {
                return true;
            });

            $("#btnExport").click(function () {
                //导出Excel
                $("#btnServerExport").click();
            });

            $("#btnClear").click(function () {
                $.post(
                    '../../Handlers/LogHandler.aspx?op=delete',
                    {
                        startDate: $("#startDate").val(),
                        endDate: $("#endDate").val(),
                        logType: $("#logType").combobox("getValue"),
                        uid: $("#uid").combogrid("getValue"),
                        txtKeyw: $("#txtKeyw").val()
                    },
                    function (data) {
                        if (data.success) {
                            alert("成功清空查询出的日志记录！");
                            $("#btnSearch").click();
                        }
                        else {
                            alert("清空日志发生异常，请联系系统管理员！");
                        }
                    }
                );
            });

            $("#btnSearch").click();



        });

        
    </script>

    <style type="text/css">
        .hidBtn
        {
            display:none;
            }
    </style>--%>
</head>
<body class="easyui-layout" fit="true">  
<div region="north" style="height:30px;">  
     <form id="form1" runat="server">
    <div style=" background-color:rgb(245,245,245); margin-bottom:1px;">
        <span><%: lang.Get("User_name")%> </span>
        <span>
            <select id="uid" name="uid" class="easyui-combobox" style="width:100px" data-options="
            valueField: 'USER_ID',
            textField: 'USER_NAME',
            url: '../../Handlers/CommonSearchHandler.ashx?op=queryalluser',
            method: 'get',
            mode:'remote'
            " >
    </select>
        </span>
        <span style=" margin-right:4px;"><%: lang.Get("log_type")%></span><span>
            <select id="logType" name="logType" class="easyui-combobox" style="width: 150px;">
               <option value="Login"><%: lang.Get("login")%></option>
                <option value="Logout"><%: lang.Get("off")%></option>
                <option value="ScanPage"><%: lang.Get("Module_using")%></option>
                <option value="Search"><%: lang.Get("Search_for_file")%></option>
                <option value="ScanFile"><%: lang.Get("Online_browse_file")%></option>
                <option value="DownFile"><%: lang.Get("Download_file")%></option>
                <option value="DeleteFile"><%: lang.Get("Delete_file")%></option>
            </select>
        </span>
        <span>
            <%: lang.Get("Start_date")%>
        </span>
        <span>
            <input id="startDate" name="startDate" style="width:100px" runat="Server" type="text" onclick="WdatePicker()" />
        </span>
        <span><%: lang.Get("The_deadline")%></span>
        <span>
            <input id="endDate" name="endDate" style="width:100px" runat="Server" type="text" onclick="WdatePicker()"  />
        </span>

        <span><%: lang.Get("SPACE_Key_word")%></span>
        <span>
            <input id="txtKeyw" name="txtKeyw"  runat="Server" type="text"  />
        </span>

        <span>
            <a id="btnSearch" href="#" class="easyui-linkbutton" ><%: lang.Get("Query")%></a>
            
            <a id="btnExport" href="#" class="easyui-linkbutton" ><%: lang.Get("Export")%></a>

            <asp:Button  CssClass="hidBtn" runat="Server" ID="btnServerExport"
             OnClick="btnServerExport_Click" style="display:none;"/>

            <a id="btnClear" href="#" class="easyui-linkbutton" ><%: lang.Get("Clear log")%></a>
        </span>
    </div></form>
    </div>
    <div region="center" >
       <div id="logTable"> 
       </div>
    </div>
    
</body>
</html>
